package com.yxlgateway.gateway.controller;

import com.yxlcommon.common.dto.UploadDTO;
import com.yxlgateway.service.UploadService;
import com.yxlgateway.utils.MinioUtil;
import com.yxlcommon.common.vo.UploadVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * @author: yxl
 * @since: 2022-04-22
 **/
@RestController
@RequestMapping("/uploadController")
public class UploadController {

    @Autowired
    private MinioUtil minioUtil;
    @Autowired
    private UploadService uploadService;

    @PostMapping("/uploadFile")
    public UploadVo uploadFile(MultipartFile[] file, @RequestBody UploadDTO uploadDTO) throws Exception {
        return uploadService.uploadFile(file,uploadDTO);
    }

//    @PostMapping("/createBucket")
//    public RespBean<UploadVo> createBucket(@RequestBody UploadDTO uploadDTO) throws Exception {
//        return uploadService.createBucket(uploadDTO);
//    }
//
//    @PostMapping("/deleteBucket")
//    public RespBean<UploadVo> deleteBucket(@RequestBody UploadDTO uploadDTO) throws Exception {
//        return uploadService.deleteBucket(uploadDTO);
//    }
}
